<template>
  <div class="body_content subPage" :style="{height: client.height-142 + 'px'}">
    <LeftMenu :data="secondNav" class="left" />
    <router-view class="subview" />
  </div>
</template>
<script>
  import {
    recursion
  } from "../../lib/utils";
  import LeftMenu from './leftMenu';
  import {
    mapState
  } from 'vuex';
  export default {
    computed: {
      ...mapState({
        client: state => state.client,
        userRole: state => state.userRole,
      }),
    },
    components: {
      LeftMenu
    },
    data() {
      return {
        secondNav: []
      }
    },
    methods: {
      checked() {
        this.secondNav = recursion(46, 'id', this.userRole.menuPermissionList).children;
      }
    },
    mounted() {
      this.checked();
    }
  }

</script>

<style scoped>
  .body_content {
    background: #ebebeb;
    display: flex;
  }

  .left {
    width: 258px;
  }

  .subview {
    width: calc(100% - 278px);
    height: inherit;
  }

</style>

